home *** CD-ROM | disk | FTP | other *** search
- Path: in1.uu.net!interaccess!usenet
- From: brianmcg@interaccess.com (Brian V. McGroarty)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: I dont want BIOS to get the keystrokes..
- Date: 22 Mar 1996 01:57:32 GMT
- Organization: Internet Squire
- Message-ID: <4it1ec$a7h@nntp.interaccess.com>
- References: <4imdph$497@dos.canit.se>
- Reply-To: brianmcg@interaccess.com
- NNTP-Posting-Host: d216.nhe.interaccess.com
- X-Newsreader: Internet Squire 1.20
-
- If you aren't going to pass a key to the BIOS to handle, you must still
- acknowledge the receipt of the key to keep the keyboard hardware happy.
- The code to do that is as follows:
-
- asm {
- in al,0x61
- mov ah,al
- or al,0x80
- out 0x61,al
- xchg al,ah
- out 0x61,al
- }
-
- ..or -
- char temp;
-
- temp= inportb( 0x61 );
- outportb( 0x61, temp | 0x80 );
- outportb( 0x61, temp );
-
- Note that before you do this you may want to read the current character
- from port 0x60.
-
-
- ps. -- This is a fairly PC-specific question -- you might get fastest
- results with this sort of question by posting to an MS-DOS programming
- group.
-
-
-
-
- Stefan Ottosson wrote:
- >why doesn4t this work:? ( Borland C++)
-
- [...]
-
- >void interrupt keyb(__CPPARGS)
- >{
- >n++;
- >}
-
- >int main()
- >{
- >oldhandler = getvect(BIOSINT);
- >setvect(BIOSINT,keyb);
- >while (n < 30) {};
- >setvect(BIOSINT,oldhandler);
- >return 0;
- >}
-
-
-
-
- >what I4m trying to do is to take over interupt 9h and do nothing until
- >the interupt has been called 30 times, and then return to dos..
- >It works if I call oldhandler() in keyb(), but I dont want to give the
- >keystrokes to BIOS!!
-
-
-
-
- Take care!
-
-
-
- ---
- Brian Valters McGroarty -- brianmcg@bix.com
- phone/fax (847) 439-7714
-
-
-
-
-